package com.googlecode.continuity.core.server.service;

import org.acegisecurity.userdetails.UserDetailsService;
import com.googlecode.continuity.core.client.ContinuityUser;
import com.googlecode.continuity.core.client.GrantedAuthority;
import com.googlecode.continuity.core.server.security.SecurityUserToken;

/**
 * UserService
 *
 * @author Peter Schmitt <aragos@aragos.de>
 */
public interface UserService extends UserDetailsService {

  public SecurityUserToken getUserById(int id);

  public void storeUser(SecurityUserToken user);

  public void refreshUser(SecurityUserToken user);

  public int getUserCount();

  public boolean isCorrectPassword(SecurityUserToken user, String password);

  public String encodePassword(String password);

  public GrantedAuthority getAuthorityByName(String name);

  public void setInitialValues(SecurityUserToken user);

  public ContinuityUser getUserByName(String name);
}
